#汽车品牌

import pandas as pd
df=pd.read_csv("二手车基本信息.csv")

df_title = df.apply(lambda x:x['标题'].split(' ')[0], axis=1)
title_list = df_title.value_counts().index.tolist()[:10]
title_num = df_title.value_counts().tolist()[:10]
from pyecharts import options as opts
from pyecharts.charts import Bar

c = (
    Bar()
    .add_xaxis(title_list)
    .add_yaxis("汽车品牌", title_num)
    .set_colors(["cyan","gray"])
    .set_global_opts(
        xaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(rotate=-15)),
        title_opts=opts.TitleOpts(title="汽车品牌数量前十"),
    )
    .render("bigdata/cardata/汽车品牌前十.html")

)

